package cn.cmeizu.spring6.jdbc.xmltx.controller;

import cn.cmeizu.spring6.jdbc.xmltx.service.BookService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;

/**
 * @author cmeizu
 * @date 2023/2/12 23:02
 */
@Controller
public class BookController {

  @Autowired
  private BookService bookService;

  /**
   * 买书的方法: 图书id和用户id
   *
   * @param bookId 图书id
   * @param userId 用户id
   */
  public void buyBook(Integer bookId, Integer userId) throws InterruptedException {
    bookService.buyBook(bookId, userId);
  }
}
